"use strict"

/**
 * 测试solr全文检索
 *  
 */

var dateFormat = require('dateformat');
require('date-utils');
var indexer = require("./index");

var q = { "title": "税务 国家税务", "source": "安徽国家税务局" };

var now = Date.today();

var startDay = indexer.getBeforeDate(9);

q.create_time = {
    start: startDay,
    end: now,
    field: "create_time"
};

indexer.query(q, 0, 10, function (err, data) {
    if (!data) {
        console.log("没有找到资源");
        return;
    }
    console.log("total : " + data.response.numFound);
    console.log(data.response.docs);
});


var test = "你好,我的朋友，我是涂飞平";
console.log(test.replace(/,/g, " ").replace(/，/g,  " "));